package org.stars.dao.sqlmapper.macro;

import org.stars.dao.sqlmapper.SqlDefinition;
import org.stars.dao.sqlmapper.SqlMacro;
import org.stars.dao.sqlmapper.SqlMapper;

@MacroDefinition(body=MacroParam.REQUIRED, evaluation=MacroEvaluation.RUNTIME)
public class Echo extends MacroBase {
	@Override
	public ReturnState execute(SqlMapper sqlMapper, SqlDefinition sqlQuery, SqlMacro sqlMacro) throws Exception {
		log.info("ECHO "+sqlMacro.getTemplateText());
		log.info("param"+sqlMacro.getArgs().get(0));
		
		sqlMacro.setTemplateText("");
		sqlMacro.getParts().clear();
		
		return ReturnState.DO_NOTHING;
	}

}
